/*
* created by Administrator on 2018/12/7
* 好的代码像粥一样,是得用时间和精力熬的。
*/
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
let mongoConnect = app => {
    mongoose.connect('mongodb://localhost:27017/qiniu', (error) => {
        if (!error) {
            app.listen(8888, () => console.log('数据库连接成功，开启端口8888成功'));
        }
    })
};
const picSchema = new Schema({
    url: String
});
const picModel = mongoose.model('pic', picSchema);
module.exports = {
    mongoConnect,
    picModel
};
